/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.dao.AgentsDAO;
import model.pojo.Agents;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

/**
 *
 * @author tho
 */
public class AgentsController implements Controller{

    @Override
    public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
        ModelAndView mav = new ModelAndView("Agentss");
        try {
            List<Agents> lis = AgentsDAO.getLS();
            mav.addObject("users",lis);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mav;
    }
    
}
